<!DOCTYPE html>
<html class="reftest-wait">
  <!-- Test: if a button has is candidate for constraint validation then change
             its type to be barred from constraint validation, it should not be
             affected by :invalid pseudo-class. -->
  <link rel='stylesheet' type='text/css' href='style.css'>
  <script>
    function onLoadHandler()
    {
      var b = document.getElementById('b');
      b.setCustomValidity('foo');
      b.type = 'button';
      document.documentElement.className='';
    }
  </script>
  <body onload="document.getElementById('b').type='button'; document.documentElement.className='';">
    <button class='notinvalid' type='submit' id='b'></button>
  </body>
</html>
